//
//  KCCTVRequest.m
//  Keping
//
//  Created by 柯平 on 2017/9/1.
//  Copyright © 2017年 柯平. All rights reserved.
//

#import "KCCTVRequest.h"

@implementation KCCTVRequest

-(NSString *)requestUrl
{
    return KUserCCTVsURL;
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodGET;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end

@implementation kCCTVSettingRequest {
    NSString *_requestUrl;
}

-(instancetype)initWithCctvPartyId:(NSString *)cctvPartyId {
    if (![cctvPartyId isNotBlank])
        return nil;
    if (self) {
        _requestUrl = [[NSString stringWithFormat:@"/intelligentcommunity/api/ec/cctv/v1/cctvPartys/update/%@.htm",cctvPartyId] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    }
    return self;
}

-(NSString *)requestUrl
{
    return _requestUrl;//KUpdateUserCCTVURL
}

-(KRequestMethod)requestMethod
{
    return KRequestMethodPOST;
}

-(id)requestArgument
{
    return self.params;
}

-(NSDictionary<NSString *,NSString *> *)requestHeaderFieldValueDictionary
{
    return @{@"Cookie":[KAppConfig sharedConfig].sessionId?:@""};
}

@end
